{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1327
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var
	ls : longint;
	p : array[0..1000010] of longint;
	s : string;	
 
procedure prefix(s : string);
 
var 
	m, k, q : longint;
 
begin
	fillchar(p, sizeof(p), 0);
	m := length(s);
	p[1] := 0;
	k := 0;
	for q := 2 to m do begin
		while (k > 0) and (s[k + 1] <> s[q]) do k := p[k];
		if s[k + 1] = s[q] then inc(k);
		p[q] := k;
	end;
end;
 
begin
	reset(input,'input.txt');
	rewrite(output,'output.txt');
	readln(s);
	prefix(s);
	ls := length(s);
	if ls mod (ls - p[ls]) = 0 then write(ls div (ls - p[ls])) else write(1);
end.